<template>
	<div>
		<home-header></home-header>
	    <home-swiper :list="swiperList"></home-swiper>
	    <home-icons :icon="iconList"></home-icons>
	    <home-recommend :recommend="recommendList"></home-recommend>
	    <home-weekend :weekList="weekendList"></home-weekend>
	</div>
</template>

<script>
import HomeHeader from 'src/pages/components/header'
import HomeSwiper from 'src/pages/components/swiper' 
import HomeIcons from 'src/pages/components/icons'
import HomeRecommend from 'src/pages/components/recommend'
import HomeWeekend from 'src/pages/components/weekend'
import axios from 'axios'
export default{
	components:{
		HomeHeader,
		HomeSwiper,
		HomeIcons,
		HomeRecommend,
		HomeWeekend
	
	},
	data (){
		return{
			swiperList:[],
			iconList:[],
			recommendList:[],
			weekendList:[]
		}
	},
	methods:{
		getSwiperInfo(){
			axios.get('api/index.json')
			.then(this.getSwiperInfoSucc)
		},
		getSwiperInfoSucc (res){
			res=res.data
			if(res.ret && res.data){
				const data=res.data
				this.swiperList=data.swiperList
				this.iconList=data.iconList
				this.recommendList=data.recommendList
				this.weekendList=data.weekendList
			}
		}
	},
	mounted (){
		this.getSwiperInfo()
	}
}
</script>

<style>
</style>